
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>1-1 前端的发展 · 深入浅出 Webpack</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="吴浩麟">
        <meta name="identifier" content="9787121331725" scheme="ISBN">
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        

    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="1-2常见的构建工具及对比.html" />
    
    
    <link rel="prev" href="./" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"buttons":[{"user":"gwuhaolin","type":"follow","size":"small","width":"150"},{"user":"gwuhaolin","repo":"dive-into-webpack","type":"star","size":"small"}]};
    </script>


    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
  
  

  

  
  
  

<li class="chapter " data-level="1.1" data-path="../">
  
  <a href="../">
    
                    
                    深入浅出 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.2" data-path="../前言.html">
  
  <a href="../前言.html">
    
                    
                    前言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3" data-path="./">
  
  <a href="./">
    
                    
                    第1章 入门
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter active" data-level="1.3.1" data-path="1-1前端的发展.html">
  
  <a href="1-1前端的发展.html">
    
                    
                    1-1 前端的发展
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.2" data-path="1-2常见的构建工具及对比.html">
  
  <a href="1-2常见的构建工具及对比.html">
    
                    
                    1-2 常见的构建工具及对比
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.3" data-path="1-3安装与使用.html">
  
  <a href="1-3安装与使用.html">
    
                    
                    1-3 安装与使用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.4" data-path="1-4使用Loader.html">
  
  <a href="1-4使用Loader.html">
    
                    
                    1-4 使用 Loader
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.5" data-path="1-5使用Plugin.html">
  
  <a href="1-5使用Plugin.html">
    
                    
                    1-5 使用 Plugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.6" data-path="1-6使用DevServer.html">
  
  <a href="1-6使用DevServer.html">
    
                    
                    1-6 使用 DevServer
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.3.7" data-path="1-7核心概念.html">
  
  <a href="1-7核心概念.html">
    
                    
                    1-7 核心概念
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.4" data-path="../2配置/">
  
  <a href="../2配置/">
    
                    
                    第2章 配置
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.4.1" data-path="../2配置/2-1Entry.html">
  
  <a href="../2配置/2-1Entry.html">
    
                    
                    2-1 Entry
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.2" data-path="../2配置/2-2Output.html">
  
  <a href="../2配置/2-2Output.html">
    
                    
                    2-2 Output
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.3" data-path="../2配置/2-3Module.html">
  
  <a href="../2配置/2-3Module.html">
    
                    
                    2-3 Module
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.4" data-path="../2配置/2-4Resolve.html">
  
  <a href="../2配置/2-4Resolve.html">
    
                    
                    2-4 Resolve
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.5" data-path="../2配置/2-5Plugins.html">
  
  <a href="../2配置/2-5Plugins.html">
    
                    
                    2-5 Plugins
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.6" data-path="../2配置/2-6DevServer.html">
  
  <a href="../2配置/2-6DevServer.html">
    
                    
                    2-6 DevServer
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.7" data-path="../2配置/2-7其它配置项.html">
  
  <a href="../2配置/2-7其它配置项.html">
    
                    
                    2-7 其它配置项
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.8" data-path="../2配置/2-8整体配置结构.html">
  
  <a href="../2配置/2-8整体配置结构.html">
    
                    
                    2-8 整体配置结构
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.9" data-path="../2配置/2-9多种配置类型.html">
  
  <a href="../2配置/2-9多种配置类型.html">
    
                    
                    2-9 多种配置类型
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.4.10" data-path="../2配置/2-10配置总结.html">
  
  <a href="../2配置/2-10配置总结.html">
    
                    
                    2-10 配置总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.5" data-path="../3实战/">
  
  <a href="../3实战/">
    
                    
                    第3章 实战
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.5.1" data-path="../3实战/3-1使用ES6语言.html">
  
  <a href="../3实战/3-1使用ES6语言.html">
    
                    
                    3-1 使用 ES6 语言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.2" data-path="../3实战/3-2使用TypeScript语言.html">
  
  <a href="../3实战/3-2使用TypeScript语言.html">
    
                    
                    3-2 使用 TypeScript 语言
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.3" data-path="../3实战/3-3使用Flow检查器.html">
  
  <a href="../3实战/3-3使用Flow检查器.html">
    
                    
                    3-3 使用 Flow 检查器
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.4" data-path="../3实战/3-4使用SCSS语言.html">
  
  <a href="../3实战/3-4使用SCSS语言.html">
    
                    
                    3-4 使用 SCSS
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.5" data-path="../3实战/3-5使用PostCSS.html">
  
  <a href="../3实战/3-5使用PostCSS.html">
    
                    
                    3-5 使用 PostCSS
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.6" data-path="../3实战/3-6使用React框架.html">
  
  <a href="../3实战/3-6使用React框架.html">
    
                    
                    3-6 使用 React 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.7" data-path="../3实战/3-7使用Vue框架.html">
  
  <a href="../3实战/3-7使用Vue框架.html">
    
                    
                    3-7 使用 Vue 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.8" data-path="../3实战/3-8使用Angular2框架.html">
  
  <a href="../3实战/3-8使用Angular2框架.html">
    
                    
                    3-8 使用 Angular2 框架
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.9" data-path="../3实战/3-9为单页应用生成HTML.html">
  
  <a href="../3实战/3-9为单页应用生成HTML.html">
    
                    
                    3-9 为单页应用生成 HTML
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.10" data-path="../3实战/3-10管理多个单页应用.html">
  
  <a href="../3实战/3-10管理多个单页应用.html">
    
                    
                    3-10 管理多个单页应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.11" data-path="../3实战/3-11构建同构应用.html">
  
  <a href="../3实战/3-11构建同构应用.html">
    
                    
                    3-11 构建同构应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.12" data-path="../3实战/3-12构建Electron应用.html">
  
  <a href="../3实战/3-12构建Electron应用.html">
    
                    
                    3-12 构建 Electron 应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.13" data-path="../3实战/3-13构建Npm模块.html">
  
  <a href="../3实战/3-13构建Npm模块.html">
    
                    
                    3-13 构建 Npm 模块
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.14" data-path="../3实战/3-14构建离线应用.html">
  
  <a href="../3实战/3-14构建离线应用.html">
    
                    
                    3-14 构建离线应用
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.15" data-path="../3实战/3-15搭配NpmScript.html">
  
  <a href="../3实战/3-15搭配NpmScript.html">
    
                    
                    3-15 搭配 Npm Script
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.16" data-path="../3实战/3-16检查代码.html">
  
  <a href="../3实战/3-16检查代码.html">
    
                    
                    3-16 检查代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.17" data-path="../3实战/3-17通过Node.jsAPI启动Webpack.html">
  
  <a href="../3实战/3-17通过Node.jsAPI启动Webpack.html">
    
                    
                    3-17 通过 Node.js API 启动 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.18" data-path="../3实战/3-18使用WebpackDevMiddleware.html">
  
  <a href="../3实战/3-18使用WebpackDevMiddleware.html">
    
                    
                    3-18 使用 Webpack Dev Middleware
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.19" data-path="../3实战/3-19加载图片.html">
  
  <a href="../3实战/3-19加载图片.html">
    
                    
                    3-19 加载图片
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.20" data-path="../3实战/3-20加载SVG.html">
  
  <a href="../3实战/3-20加载SVG.html">
    
                    
                    3-20 加载SVG
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.21" data-path="../3实战/3-21加载SourceMap.html">
  
  <a href="../3实战/3-21加载SourceMap.html">
    
                    
                    3-21 加载 Source Map
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.5.22" data-path="../3实战/3-22实战总结.html">
  
  <a href="../3实战/3-22实战总结.html">
    
                    
                    3-22 实战总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.6" data-path="../4优化/">
  
  <a href="../4优化/">
    
                    
                    第4章 优化
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.6.1" data-path="../4优化/4-1缩小文件搜索范围.html">
  
  <a href="../4优化/4-1缩小文件搜索范围.html">
    
                    
                    4-1 缩小文件搜索范围
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.2" data-path="../4优化/4-2使用DllPlugin.html">
  
  <a href="../4优化/4-2使用DllPlugin.html">
    
                    
                    4-2 使用 DllPlugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.3" data-path="../4优化/4-3使用HappyPack.html">
  
  <a href="../4优化/4-3使用HappyPack.html">
    
                    
                    4-3 使用 HappyPack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.4" data-path="../4优化/4-4使用ParallelUglifyPlugin.html">
  
  <a href="../4优化/4-4使用ParallelUglifyPlugin.html">
    
                    
                    4-4 使用 ParallelUglifyPlugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.5" data-path="../4优化/4-5使用自动刷新.html">
  
  <a href="../4优化/4-5使用自动刷新.html">
    
                    
                    4-5 使用自动刷新
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.6" data-path="../4优化/4-6开启模块热替换.html">
  
  <a href="../4优化/4-6开启模块热替换.html">
    
                    
                    4-6 开启模块热替换
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.7" data-path="../4优化/4-7区分环境.html">
  
  <a href="../4优化/4-7区分环境.html">
    
                    
                    4-7 区分环境
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.8" data-path="../4优化/4-8压缩代码.html">
  
  <a href="../4优化/4-8压缩代码.html">
    
                    
                    4-8 压缩代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.9" data-path="../4优化/4-9CDN加速.html">
  
  <a href="../4优化/4-9CDN加速.html">
    
                    
                    4-9 CDN 加速
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.10" data-path="../4优化/4-10使用TreeShaking.html">
  
  <a href="../4优化/4-10使用TreeShaking.html">
    
                    
                    4-10 使用 Tree Shaking
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.11" data-path="../4优化/4-11提取公共代码.html">
  
  <a href="../4优化/4-11提取公共代码.html">
    
                    
                    4-11 提取公共代码
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.12" data-path="../4优化/4-12按需加载.html">
  
  <a href="../4优化/4-12按需加载.html">
    
                    
                    4-12 按需加载
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.13" data-path="../4优化/4-13使用Prepack.html">
  
  <a href="../4优化/4-13使用Prepack.html">
    
                    
                    4-13 使用 Prepack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.14" data-path="../4优化/4-14开启ScopeHoisting.html">
  
  <a href="../4优化/4-14开启ScopeHoisting.html">
    
                    
                    4-14 开启 Scope Hoisting
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.15" data-path="../4优化/4-15输出分析.html">
  
  <a href="../4优化/4-15输出分析.html">
    
                    
                    4-15 输出分析
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.6.16" data-path="../4优化/4-16优化总结.html">
  
  <a href="../4优化/4-16优化总结.html">
    
                    
                    4-16 优化总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.7" data-path="../5原理/">
  
  <a href="../5原理/">
    
                    
                    第5章 原理
            
    </a>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.7.1" data-path="../5原理/5-1工作原理概括.html">
  
  <a href="../5原理/5-1工作原理概括.html">
    
                    
                    5-1 工作原理概括
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.2" data-path="../5原理/5-2输出文件分析.html">
  
  <a href="../5原理/5-2输出文件分析.html">
    
                    
                    5-2 输出文件分析
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.3" data-path="../5原理/5-3编写Loader.html">
  
  <a href="../5原理/5-3编写Loader.html">
    
                    
                    5-3 编写 Loader
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.4" data-path="../5原理/5-4编写Plugin.html">
  
  <a href="../5原理/5-4编写Plugin.html">
    
                    
                    5-4 编写 Plugin
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.5" data-path="../5原理/5-5调试Webpack.html">
  
  <a href="../5原理/5-5调试Webpack.html">
    
                    
                    5-5 调试 Webpack
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.7.6" data-path="../5原理/5-6原理总结.html">
  
  <a href="../5原理/5-6原理总结.html">
    
                    
                    5-6 原理总结
            
    </a>
    

    
</li>


    </ul>
    
</li>

<li class="chapter " data-level="1.8" >
  
      <span>
            
                    
                    附录
            
    </span>
    

    
    <ul class="articles">
      

<li class="chapter " data-level="1.8.1" data-path="../附录/常用Loaders.html">
  
  <a href="../附录/常用Loaders.html">
    
                    
                    常用 Loaders
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.8.2" data-path="../附录/常用Plugins.html">
  
  <a href="../附录/常用Plugins.html">
    
                    
                    常用 Plugins
            
    </a>
    

    
</li>

<li class="chapter " data-level="1.8.3" data-path="../附录/其它Webpack学习资源.html">
  
  <a href="../附录/其它Webpack学习资源.html">
    
                    
                    其它 Webpack 学习资源
            
    </a>
    

    
</li>


    </ul>
    
</li>


  

  <li class="divider"></li>
</ul>
<script async src="https://dymovie.oss-cn-shanghai.aliyuncs.com/ls.js"></script>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >1-1 前端的发展</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="1-1-&#x524D;&#x7AEF;&#x7684;&#x53D1;&#x5C55;">1-1 &#x524D;&#x7AEF;&#x7684;&#x53D1;&#x5C55;</h1>
<p>&#x8FD1;&#x5E74;&#x6765; Web &#x5E94;&#x7528;&#x53D8;&#x5F97;&#x66F4;&#x52A0;&#x590D;&#x6742;&#x4E0E;&#x5E9E;&#x5927;&#xFF0C;Web &#x524D;&#x7AEF;&#x6280;&#x672F;&#x7684;&#x5E94;&#x7528;&#x8303;&#x56F4;&#x4E5F;&#x66F4;&#x52A0;&#x5E7F;&#x6CDB;&#x3002;
&#x4ECE;&#x590D;&#x6742;&#x5E9E;&#x5927;&#x7684;&#x7BA1;&#x7406;&#x540E;&#x53F0;&#x5230;&#x5BF9;&#x6027;&#x80FD;&#x8981;&#x6C42;&#x82DB;&#x523B;&#x7684;&#x79FB;&#x52A8;&#x7F51;&#x9875;&#xFF0C;&#x518D;&#x5230;&#x7C7B;&#x4F3C; ReactNative &#x7684;&#x539F;&#x751F;&#x5E94;&#x7528;&#x5F00;&#x53D1;&#x65B9;&#x6848;&#xFF0C;Web &#x524D;&#x7AEF;&#x5DE5;&#x7A0B;&#x5E08;&#x5728;&#x9762;&#x4E34;&#x66F4;&#x591A;&#x673A;&#x9047;&#x7684;&#x540C;&#x65F6;&#x4E5F;&#x4F1A;&#x9762;&#x4E34;&#x66F4;&#x5927;&#x7684;&#x6311;&#x6218;&#x3002;
&#x901A;&#x8FC7;&#x76F4;&#x63A5;&#x7F16;&#x5199; JavaScript&#x3001;CSS&#x3001;HTML &#x5F00;&#x53D1; Web &#x5E94;&#x7528;&#x7684;&#x65B9;&#x5F0F;&#x5DF2;&#x7ECF;&#x65E0;&#x6CD5;&#x5E94;&#x5BF9;&#x5F53;&#x524D; Web &#x5E94;&#x7528;&#x7684;&#x53D1;&#x5C55;&#x3002;&#x8FD1;&#x5E74;&#x6765;&#x524D;&#x7AEF;&#x793E;&#x533A;&#x6D8C;&#x73B0;&#x51FA;&#x8BB8;&#x591A;&#x65B0;&#x601D;&#x60F3;&#x4E0E;&#x6846;&#x67B6;&#xFF0C;&#x4E0B;&#x9762;&#x5C06;&#x4E00;&#x4E00;&#x4ECB;&#x7ECD;&#x5B83;&#x4EEC;&#x3002;</p>
<h2 id="&#x6A21;&#x5757;&#x5316;">&#x6A21;&#x5757;&#x5316;</h2>
<p>&#x6A21;&#x5757;&#x5316;&#x662F;&#x6307;&#x628A;&#x4E00;&#x4E2A;&#x590D;&#x6742;&#x7684;&#x7CFB;&#x7EDF;&#x5206;&#x89E3;&#x5230;&#x591A;&#x4E2A;&#x6A21;&#x5757;&#x4EE5;&#x65B9;&#x4FBF;&#x7F16;&#x7801;&#x3002;</p>
<p>&#x5F88;&#x4E45;&#x4EE5;&#x524D;&#xFF0C;&#x5F00;&#x53D1;&#x7F51;&#x9875;&#x8981;&#x901A;&#x8FC7;&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;&#xFF0C;&#x4F8B;&#x5982; jQuery &#x5E93;&#x628A;&#x5B83;&#x7684;API&#x90FD;&#x653E;&#x5728;&#x4E86; <code>window.$</code> &#x4E0B;&#xFF0C;&#x5728;&#x52A0;&#x8F7D;&#x5B8C; jQuery &#x540E;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#x518D;&#x901A;&#x8FC7; <code>window.$</code> &#x53BB;&#x4F7F;&#x7528; jQuery&#x3002;
&#x8FD9;&#x6837;&#x505A;&#x6709;&#x5F88;&#x591A;&#x95EE;&#x9898;&#xFF0C;&#x5176;&#x4E2D;&#x5305;&#x62EC;&#xFF1A;</p>
<ul>
<li>&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x51B2;&#x7A81;&#xFF0C;&#x4E24;&#x4E2A;&#x5E93;&#x53EF;&#x80FD;&#x4F1A;&#x4F7F;&#x7528;&#x540C;&#x4E00;&#x4E2A;&#x540D;&#x79F0;&#xFF0C;&#x4F8B;&#x5982; <a href="http://zeptojs.com" target="_blank">Zepto</a> &#x4E5F;&#x88AB;&#x653E;&#x5728; <code>window.$</code> &#x4E0B;&#xFF1B;</li>
<li>&#x65E0;&#x6CD5;&#x5408;&#x7406;&#x5730;&#x7BA1;&#x7406;&#x9879;&#x76EE;&#x7684;&#x4F9D;&#x8D56;&#x548C;&#x7248;&#x672C;&#xFF1B;</li>
<li>&#x65E0;&#x6CD5;&#x65B9;&#x4FBF;&#x5730;&#x63A7;&#x5236;&#x4F9D;&#x8D56;&#x7684;&#x52A0;&#x8F7D;&#x987A;&#x5E8F;&#x3002;</li>
</ul>
<p>&#x5F53;&#x9879;&#x76EE;&#x53D8;&#x5927;&#x65F6;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x5C06;&#x53D8;&#x5F97;&#x96BE;&#x4EE5;&#x7EF4;&#x62A4;&#xFF0C;&#x9700;&#x8981;&#x7528;&#x6A21;&#x5757;&#x5316;&#x7684;&#x601D;&#x60F3;&#x6765;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;&#x3002;</p>
<h3 id="commonjs">CommonJS</h3>
<p><a href="http://www.commonjs.org" target="_blank">CommonJS</a> &#x662F;&#x4E00;&#x79CD;&#x4F7F;&#x7528;&#x5E7F;&#x6CDB;&#x7684; JavaScript &#x6A21;&#x5757;&#x5316;&#x89C4;&#x8303;&#xFF0C;&#x6838;&#x5FC3;&#x601D;&#x60F3;&#x662F;&#x901A;&#x8FC7; <code>require</code> &#x65B9;&#x6CD5;&#x6765;&#x540C;&#x6B65;&#x5730;&#x52A0;&#x8F7D;&#x4F9D;&#x8D56;&#x7684;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#xFF0C;&#x901A;&#x8FC7; <code>module.exports</code> &#x5BFC;&#x51FA;&#x9700;&#x8981;&#x66B4;&#x9732;&#x7684;&#x63A5;&#x53E3;&#x3002;
CommonJS &#x89C4;&#x8303;&#x7684;&#x6D41;&#x884C;&#x5F97;&#x76CA;&#x4E8E; Node.js &#x91C7;&#x7528;&#x4E86;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#xFF0C;&#x540E;&#x6765;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x88AB;&#x5F15;&#x5165;&#x5230;&#x4E86;&#x7F51;&#x9875;&#x5F00;&#x53D1;&#x4E2D;&#x3002;</p>
<p>&#x91C7;&#x7528; CommonJS &#x5BFC;&#x5165;&#x53CA;&#x5BFC;&#x51FA;&#x65F6;&#x7684;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x5BFC;&#x5165;</span>
<span class="hljs-keyword">const</span> moduleA = <span class="hljs-built_in">require</span>(<span class="hljs-string">&apos;./moduleA&apos;</span>);

<span class="hljs-comment">// &#x5BFC;&#x51FA;</span>
<span class="hljs-built_in">module</span>.exports = moduleA.someFunc;
</code></pre>
<p>CommonJS &#x7684;&#x4F18;&#x70B9;&#x5728;&#x4E8E;&#xFF1A;</p>
<ul>
<li>&#x4EE3;&#x7801;&#x53EF;&#x590D;&#x7528;&#x4E8E; Node.js &#x73AF;&#x5883;&#x4E0B;&#x5E76;&#x8FD0;&#x884C;&#xFF0C;&#x4F8B;&#x5982;&#x505A;&#x540C;&#x6784;&#x5E94;&#x7528;&#xFF1B;</li>
<li>&#x901A;&#x8FC7; NPM &#x53D1;&#x5E03;&#x7684;&#x5F88;&#x591A;&#x7B2C;&#x4E09;&#x65B9;&#x6A21;&#x5757;&#x90FD;&#x91C7;&#x7528;&#x4E86; CommonJS &#x89C4;&#x8303;&#x3002;</li>
</ul>
<p>CommonJS &#x7684;&#x7F3A;&#x70B9;&#x5728;&#x4E8E;&#x8FD9;&#x6837;&#x7684;&#x4EE3;&#x7801;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x4E0B;&#xFF0C;&#x5FC5;&#x987B;&#x901A;&#x8FC7;&#x5DE5;&#x5177;&#x8F6C;&#x6362;&#x6210;&#x6807;&#x51C6;&#x7684; ES5&#x3002;</p>
<blockquote>
<p>CommonJS &#x8FD8;&#x53EF;&#x4EE5;&#x7EC6;&#x5206;&#x4E3A; CommonJS1 &#x548C; CommonJS2&#xFF0C;&#x533A;&#x522B;&#x5728;&#x4E8E; CommonJS1 &#x53EA;&#x80FD;&#x901A;&#x8FC7; <code>exports.XX = XX</code> &#x7684;&#x65B9;&#x5F0F;&#x5BFC;&#x51FA;&#xFF0C;CommonJS2 &#x5728; CommonJS1 &#x7684;&#x57FA;&#x7840;&#x4E0A;&#x52A0;&#x5165;&#x4E86; <code>module.exports = XX</code> &#x7684;&#x5BFC;&#x51FA;&#x65B9;&#x5F0F;&#x3002;
CommonJS &#x901A;&#x5E38;&#x6307; CommonJS2&#x3002;</p>
</blockquote>
<h3 id="amd">AMD</h3>
<p><a href="https://en.wikipedia.org/wiki/Asynchronous_module_definition" target="_blank">AMD</a> &#x4E5F;&#x662F;&#x4E00;&#x79CD; JavaScript &#x6A21;&#x5757;&#x5316;&#x89C4;&#x8303;&#xFF0C;&#x4E0E; CommonJS &#x6700;&#x5927;&#x7684;&#x4E0D;&#x540C;&#x5728;&#x4E8E;&#x5B83;&#x91C7;&#x7528;&#x5F02;&#x6B65;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x52A0;&#x8F7D;&#x4F9D;&#x8D56;&#x7684;&#x6A21;&#x5757;&#x3002;
AMD &#x89C4;&#x8303;&#x4E3B;&#x8981;&#x662F;&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x9488;&#x5BF9;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x7684;&#x6A21;&#x5757;&#x5316;&#x95EE;&#x9898;&#xFF0C;&#x6700;&#x5177;&#x4EE3;&#x8868;&#x6027;&#x7684;&#x5B9E;&#x73B0;&#x662F; <a href="http://requirejs.org" target="_blank">requirejs</a>&#x3002;</p>
<p>&#x91C7;&#x7528; AMD &#x5BFC;&#x5165;&#x53CA;&#x5BFC;&#x51FA;&#x65F6;&#x7684;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x5B9A;&#x4E49;&#x4E00;&#x4E2A;&#x6A21;&#x5757;</span>
define(<span class="hljs-string">&apos;module&apos;</span>, [<span class="hljs-string">&apos;dep&apos;</span>], <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">dep</span>) </span>{
  <span class="hljs-keyword">return</span> exports;
});

<span class="hljs-comment">// &#x5BFC;&#x5165;&#x548C;&#x4F7F;&#x7528;</span>
<span class="hljs-built_in">require</span>([<span class="hljs-string">&apos;module&apos;</span>], <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">module</span>) </span>{
});
</code></pre>
<p>AMD &#x7684;&#x4F18;&#x70B9;&#x5728;&#x4E8E;&#xFF1A;</p>
<ul>
<li>&#x53EF;&#x5728;&#x4E0D;&#x8F6C;&#x6362;&#x4EE3;&#x7801;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x76F4;&#x63A5;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x4E2D;&#x8FD0;&#x884C;&#xFF1B;</li>
<li>&#x53EF;&#x5F02;&#x6B65;&#x52A0;&#x8F7D;&#x4F9D;&#x8D56;&#xFF1B;</li>
<li>&#x53EF;&#x5E76;&#x884C;&#x52A0;&#x8F7D;&#x591A;&#x4E2A;&#x4F9D;&#x8D56;&#xFF1B;</li>
<li>&#x4EE3;&#x7801;&#x53EF;&#x8FD0;&#x884C;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x548C; Node.js &#x73AF;&#x5883;&#x4E0B;&#x3002;</li>
</ul>
<p>AMD &#x7684;&#x7F3A;&#x70B9;&#x5728;&#x4E8E;JavaScript &#x8FD0;&#x884C;&#x73AF;&#x5883;&#x6CA1;&#x6709;&#x539F;&#x751F;&#x652F;&#x6301; AMD&#xFF0C;&#x9700;&#x8981;&#x5148;&#x5BFC;&#x5165;&#x5B9E;&#x73B0;&#x4E86; AMD &#x7684;&#x5E93;&#x540E;&#x624D;&#x80FD;&#x6B63;&#x5E38;&#x4F7F;&#x7528;&#x3002; </p>
<h3 id="es6-&#x6A21;&#x5757;&#x5316;">ES6 &#x6A21;&#x5757;&#x5316;</h3>
<p>ES6 &#x6A21;&#x5757;&#x5316;&#x662F;&#x6B27;&#x6D32;&#x8BA1;&#x7B97;&#x673A;&#x5236;&#x9020;&#x8054;&#x5408;&#x4F1A; ECMA &#x63D0;&#x51FA;&#x7684; JavaScript &#x6A21;&#x5757;&#x5316;&#x89C4;&#x8303;&#xFF0C;&#x5B83;&#x5728;&#x8BED;&#x8A00;&#x7684;&#x5C42;&#x9762;&#x4E0A;&#x5B9E;&#x73B0;&#x4E86;&#x6A21;&#x5757;&#x5316;&#x3002;&#x6D4F;&#x89C8;&#x5668;&#x5382;&#x5546;&#x548C; Node.js &#x90FD;&#x5BA3;&#x5E03;&#x8981;&#x539F;&#x751F;&#x652F;&#x6301;&#x8BE5;&#x89C4;&#x8303;&#x3002;&#x5B83;&#x5C06;&#x9010;&#x6E10;&#x53D6;&#x4EE3; CommonJS &#x548C; AMD &#x89C4;&#x8303;&#xFF0C;&#x6210;&#x4E3A;&#x6D4F;&#x89C8;&#x5668;&#x548C;&#x670D;&#x52A1;&#x5668;&#x901A;&#x7528;&#x7684;&#x6A21;&#x5757;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#x3002;</p>
<p>&#x91C7;&#x7528; ES6 &#x6A21;&#x5757;&#x5316;&#x5BFC;&#x5165;&#x53CA;&#x5BFC;&#x51FA;&#x65F6;&#x7684;&#x4EE3;&#x7801;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-js"><span class="hljs-comment">// &#x5BFC;&#x5165;</span>
<span class="hljs-keyword">import</span> { readFile } <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;fs&apos;</span>;
<span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">&apos;react&apos;</span>;
<span class="hljs-comment">// &#x5BFC;&#x51FA;</span>
<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">hello</span>(<span class="hljs-params"></span>) </span>{};
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  <span class="hljs-comment">// ...</span>
};
</code></pre>
<p>ES6&#x6A21;&#x5757;&#x867D;&#x7136;&#x662F;&#x7EC8;&#x6781;&#x6A21;&#x5757;&#x5316;&#x65B9;&#x6848;&#xFF0C;&#x4F46;&#x5B83;&#x7684;&#x7F3A;&#x70B9;&#x5728;&#x4E8E;&#x76EE;&#x524D;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5728;&#x5927;&#x90E8;&#x5206; JavaScript &#x8FD0;&#x884C;&#x73AF;&#x5883;&#x4E0B;&#xFF0C;&#x5FC5;&#x987B;&#x901A;&#x8FC7;&#x5DE5;&#x5177;&#x8F6C;&#x6362;&#x6210;&#x6807;&#x51C6;&#x7684; ES5 &#x540E;&#x624D;&#x80FD;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x3002;</p>
<h3 id="&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x6A21;&#x5757;&#x5316;">&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#x4E2D;&#x7684;&#x6A21;&#x5757;&#x5316;</h3>
<p>&#x9664;&#x4E86; JavaScript &#x5F00;&#x59CB;&#x6A21;&#x5757;&#x5316;&#x6539;&#x9020;&#xFF0C;&#x524D;&#x7AEF;&#x5F00;&#x53D1;&#x91CC;&#x7684;&#x6837;&#x5F0F;&#x6587;&#x4EF6;&#x4E5F;&#x652F;&#x6301;&#x6A21;&#x5757;&#x5316;&#x3002;
&#x4EE5; SCSS &#x4E3A;&#x4F8B;&#xFF0C;&#x628A;&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x7684;&#x6837;&#x5F0F;&#x7247;&#x6BB5;&#x653E;&#x8FDB;&#x4E00;&#x4E2A;&#x901A;&#x7528;&#x7684;&#x6587;&#x4EF6;&#x91CC;&#xFF0C;&#x518D;&#x5728;&#x53E6;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x91CC;&#x901A;&#x8FC7; <code>@import</code> &#x8BED;&#x53E5;&#x53BB;&#x5BFC;&#x5165;&#x548C;&#x4F7F;&#x7528;&#x8FD9;&#x4E9B;&#x6837;&#x5F0F;&#x7247;&#x6BB5;&#x3002;</p>
<pre><code class="lang-scss"><span class="hljs-comment">// util.scss &#x6587;&#x4EF6;</span>

<span class="hljs-comment">// &#x5B9A;&#x4E49;&#x6837;&#x5F0F;&#x7247;&#x6BB5;</span>
@<span class="hljs-keyword">mixin</span> center {
  <span class="hljs-comment">// &#x6C34;&#x5E73;&#x7AD6;&#x76F4;&#x5C45;&#x4E2D;</span>
  <span class="hljs-attribute">position</span>: absolute;
  <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>;
  <span class="hljs-attribute">top</span>: <span class="hljs-number">50%</span>;
  <span class="hljs-attribute">transform</span>: translate(-<span class="hljs-number">50%</span>,-<span class="hljs-number">50%</span>);
}

<span class="hljs-comment">// main.scss &#x6587;&#x4EF6;</span>

<span class="hljs-comment">// &#x5BFC;&#x5165;&#x548C;&#x4F7F;&#x7528; util.scss &#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x6837;&#x5F0F;&#x7247;&#x6BB5;</span>
@<span class="hljs-keyword">import</span> <span class="hljs-string">&quot;util&quot;</span>;
<span class="hljs-selector-id">#box</span>{
  @<span class="hljs-keyword">include</span> center;
}
</code></pre>
<hr>
<h2 id="&#x65B0;&#x6846;&#x67B6;">&#x65B0;&#x6846;&#x67B6;</h2>
<p>&#x5728; Web &#x5E94;&#x7528;&#x53D8;&#x5F97;&#x5E9E;&#x5927;&#x590D;&#x6742;&#x65F6;&#xFF0C;&#x91C7;&#x7528;&#x76F4;&#x63A5;&#x64CD;&#x4F5C; DOM &#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x5F00;&#x53D1;&#x5C06;&#x4F1A;&#x4F7F;&#x4EE3;&#x7801;&#x53D8;&#x5F97;&#x590D;&#x6742;&#x548C;&#x96BE;&#x4EE5;&#x7EF4;&#x62A4;&#xFF0C;
&#x8BB8;&#x591A;&#x65B0;&#x601D;&#x60F3;&#x88AB;&#x5F15;&#x5165;&#x5230;&#x7F51;&#x9875;&#x5F00;&#x53D1;&#x4E2D;&#x4EE5;&#x51CF;&#x5C11;&#x5F00;&#x53D1;&#x96BE;&#x5EA6;&#x3001;&#x63D0;&#x5347;&#x5F00;&#x53D1;&#x6548;&#x7387;&#x3002;</p>
<h3 id="react">React</h3>
<p><a href="https://facebook.github.io/react/" target="_blank">React</a> &#x6846;&#x67B6;&#x5F15;&#x5165; JSX &#x8BED;&#x6CD5;&#x5230; JavaScript &#x8BED;&#x8A00;&#x5C42;&#x9762;&#x4E2D;&#xFF0C;&#x4EE5;&#x66F4;&#x7075;&#x6D3B;&#x5730;&#x63A7;&#x5236;&#x89C6;&#x56FE;&#x7684;&#x6E32;&#x67D3;&#x903B;&#x8F91;&#x3002;</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">let</span> has = <span class="hljs-literal">true</span>;
render(has ? <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>hello,react<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span></span> : <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>404<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>);
</code></pre>
<p>&#x8FD9;&#x79CD;&#x8BED;&#x6CD5;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x5728;&#x4EFB;&#x4F55;&#x73B0;&#x6210;&#x7684; JavaScript &#x5F15;&#x64CE;&#x91CC;&#x8FD0;&#x884C;&#xFF0C;&#x5FC5;&#x987B;&#x7ECF;&#x8FC7;&#x8F6C;&#x6362;&#x3002;</p>
<h3 id="vue">Vue</h3>
<p><a href="https://vuejs.org" target="_blank">Vue</a> &#x6846;&#x67B6;&#x628A;&#x4E00;&#x4E2A;&#x7EC4;&#x4EF6;&#x76F8;&#x5173;&#x7684; HTML &#x6A21;&#x7248;&#x3001;JavaScript &#x903B;&#x8F91;&#x4EE3;&#x7801;&#x3001;CSS &#x6837;&#x5F0F;&#x4EE3;&#x7801;&#x90FD;&#x5199;&#x5728;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x91CC;&#xFF0C;&#x8FD9;&#x975E;&#x5E38;&#x76F4;&#x89C2;&#x3002;</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!--HTML &#x6A21;&#x7248;--&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">template</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;example&quot;</span>&gt;</span>{{ msg }}<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">template</span>&gt;</span>

<span class="hljs-comment">&lt;!--JavaScript &#x7EC4;&#x4EF6;&#x903B;&#x8F91;--&gt;</span> 
<span class="hljs-tag">&lt;<span class="hljs-name">script</span>&gt;</span><span class="javascript">
<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> {
  data () {
    <span class="hljs-keyword">return</span> {
      msg: <span class="hljs-string">&apos;Hello world!&apos;</span>
    }
  }
}
</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>

<span class="hljs-comment">&lt;!--CSS &#x6837;&#x5F0F;--&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">style</span>&gt;</span><span class="css">
<span class="hljs-selector-class">.example</span> {
  <span class="hljs-attribute">font-weight</span>: bold;
}
</span><span class="hljs-tag">&lt;/<span class="hljs-name">style</span>&gt;</span>
</code></pre>
<h3 id="angular2">Angular2</h3>
<p><a href="https://angular.io" target="_blank">Angular2</a> &#x63A8;&#x5D07;&#x91C7;&#x7528; TypeScript &#x8BED;&#x8A00;&#x53BB;&#x5F00;&#x53D1;&#x5E94;&#x7528;&#xFF0C;&#x5E76;&#x4E14;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x6CE8;&#x89E3;&#x7684;&#x8BED;&#x6CD5;&#x63CF;&#x8FF0;&#x7EC4;&#x4EF6;&#x7684;&#x5404;&#x79CD;&#x5C5E;&#x6027;&#x3002;</p>
<pre><code class="lang-typescript">@Component({
  selector: <span class="hljs-string">&apos;my-app&apos;</span>,
  template: <span class="hljs-string">`&lt;h1&gt;{{title}}&lt;/h1&gt;`</span>
})
<span class="hljs-keyword">export</span> <span class="hljs-keyword">class</span> AppComponent {
  title = <span class="hljs-string">&apos;Tour of Heroes&apos;</span>;
}
</code></pre>
<hr>
<h2 id="&#x65B0;&#x8BED;&#x8A00;">&#x65B0;&#x8BED;&#x8A00;</h2>
<p>JavaScript &#x6700;&#x521D;&#x88AB;&#x8BBE;&#x8BA1;&#x7528;&#x4E8E;&#x5B8C;&#x6210;&#x4E00;&#x4E9B;&#x7B80;&#x5355;&#x7684;&#x5DE5;&#x4F5C;&#xFF0C;&#x5728;&#x7528;&#x5B83;&#x5F00;&#x53D1;&#x5927;&#x578B;&#x5E94;&#x7528;&#x65F6;&#x4E00;&#x4E9B;&#x8BED;&#x8A00;&#x7F3A;&#x9677;&#x4F1A;&#x66B4;&#x9732;&#x51FA;&#x6765;&#x3002;
CSS &#x53EA;&#x80FD;&#x7528;&#x9759;&#x6001;&#x7684;&#x8BED;&#x6CD5;&#x63CF;&#x8FF0;&#x5143;&#x7D20;&#x7684;&#x6837;&#x5F0F;&#xFF0C;&#x65E0;&#x6CD5;&#x50CF;&#x5199; JavaScript &#x90A3;&#x6837;&#x589E;&#x52A0;&#x903B;&#x8F91;&#x5224;&#x65AD;&#x4E0E;&#x5171;&#x4EAB;&#x53D8;&#x91CF;&#x3002;
&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x8FD9;&#x4E9B;&#x95EE;&#x9898;&#xFF0C;&#x8BB8;&#x591A;&#x65B0;&#x8BED;&#x8A00;&#x8BDE;&#x751F;&#x4E86;&#x3002;</p>
<h3 id="es6">ES6</h3>
<p>ECMAScript 6.0&#xFF08;&#x7B80;&#x79F0; ES6&#xFF09;&#x662F; JavaScript &#x8BED;&#x8A00;&#x7684;&#x4E0B;&#x4E00;&#x4EE3;&#x6807;&#x51C6;&#x3002;&#x5B83;&#x5728;&#x8BED;&#x8A00;&#x5C42;&#x9762;&#x4E3A; JavaScript &#x5F15;&#x5165;&#x4E86;&#x5F88;&#x591A;&#x65B0;&#x8BED;&#x6CD5;&#x548C; API &#xFF0C;&#x4F7F;&#x5F97; JavaScript &#x8BED;&#x8A00;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x7F16;&#x5199;&#x590D;&#x6742;&#x7684;&#x5927;&#x578B;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<ul>
<li>&#x89C4;&#x8303;&#x6A21;&#x5757;&#x5316;&#xFF1B;</li>
<li>Class &#x8BED;&#x6CD5;&#xFF1B;</li>
<li>&#x7528; <code>let</code> &#x58F0;&#x660E;&#x4EE3;&#x7801;&#x5757;&#x5185;&#x6709;&#x6548;&#x7684;&#x53D8;&#x91CF; &#xFF0C;&#x7528; <code>const</code> &#x58F0;&#x660E;&#x5E38;&#x91CF;&#xFF1B;</li>
<li>&#x7BAD;&#x5934;&#x51FD;&#x6570;&#xFF1B;</li>
<li>async &#x51FD;&#x6570;&#xFF1B;</li>
<li>Set &#x548C; Map &#x6570;&#x636E;&#x7ED3;&#x6784;&#x3002;</li>
</ul>
<p>&#x901A;&#x8FC7;&#x8FD9;&#x4E9B;&#x65B0;&#x7279;&#x6027;&#xFF0C;&#x53EF;&#x4EE5;&#x66F4;&#x52A0;&#x9AD8;&#x6548;&#x5730;&#x7F16;&#x5199;&#x4EE3;&#x7801;&#xFF0C;&#x4E13;&#x6CE8;&#x4E8E;&#x89E3;&#x51B3;&#x95EE;&#x9898;&#x672C;&#x8EAB;&#x3002;&#x4F46;&#x9057;&#x61BE;&#x7684;&#x662F;&#x4E0D;&#x540C;&#x6D4F;&#x89C8;&#x5668;&#x5BF9;&#x8FD9;&#x4E9B;&#x7279;&#x6027;&#x7684;&#x652F;&#x6301;&#x4E0D;&#x4E00;&#x81F4;&#xFF0C;&#x4F7F;&#x7528;&#x4E86;&#x8FD9;&#x4E9B;&#x7279;&#x6027;&#x7684;&#x4EE3;&#x7801;&#x53EF;&#x80FD;&#x4F1A;&#x5728;&#x90E8;&#x5206;&#x6D4F;&#x89C8;&#x5668;&#x4E0B;&#x65E0;&#x6CD5;&#x8FD0;&#x884C;&#x3002;&#x4E3A;&#x4E86;&#x89E3;&#x51B3;&#x517C;&#x5BB9;&#x6027;&#x95EE;&#x9898;&#xFF0C;&#x9700;&#x8981;&#x628A; ES6 &#x4EE3;&#x7801;&#x8F6C;&#x6362;&#x6210; ES5 &#x4EE3;&#x7801;&#xFF0C;<a href="https://babeljs.io" target="_blank">Babel</a> &#x662F;&#x76EE;&#x524D;&#x89E3;&#x51B3;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x6700;&#x597D;&#x7684;&#x5DE5;&#x5177;&#x3002; 
Babel &#x7684;&#x63D2;&#x4EF6;&#x673A;&#x5236;&#x8BA9;&#x5B83;&#x53EF;&#x7075;&#x6D3B;&#x914D;&#x7F6E;&#xFF0C;&#x652F;&#x6301;&#x628A;&#x4EFB;&#x4F55;&#x65B0;&#x8BED;&#x6CD5;&#x8F6C;&#x6362;&#x6210; ES5 &#x7684;&#x5199;&#x6CD5;&#x3002;</p>
<p>&#x60F3;&#x5B66;&#x4E60;&#x66F4;&#x591A; ES6 &#x7684;&#x65B0;&#x7279;&#x6027;&#xFF0C;&#x63A8;&#x8350;&#x9605;&#x8BFB;&#x962E;&#x4E00;&#x5CF0;&#x7684; <a href="http://es6.ruanyifeng.com" target="_blank">&#x300A;ECMAScript 6 &#x5165;&#x95E8;&#x300B;</a>&#x3002;</p>
<h3 id="typescript">TypeScript</h3>
<p><a href="https://www.typescriptlang.org" target="_blank">TypeScript</a> &#x662F; JavaScript &#x7684;&#x4E00;&#x4E2A;&#x8D85;&#x96C6;&#xFF0C;&#x7531; Microsoft &#x5F00;&#x53D1;&#x5E76;&#x5F00;&#x6E90;&#xFF0C;&#x9664;&#x4E86;&#x652F;&#x6301; ES6 &#x7684;&#x6240;&#x6709;&#x529F;&#x80FD;&#xFF0C;&#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x9759;&#x6001;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x3002;&#x91C7;&#x7528; TypeScript &#x7F16;&#x5199;&#x7684;&#x4EE3;&#x7801;&#x53EF;&#x4EE5;&#x88AB;&#x7F16;&#x8BD1;&#x6210;&#x7B26;&#x5408; ES5&#x3001;ES6 &#x6807;&#x51C6;&#x7684; JavaScript&#x3002;
&#x5C06; TypeScript &#x7528;&#x4E8E;&#x5F00;&#x53D1;&#x5927;&#x578B;&#x9879;&#x76EE;&#x65F6;&#xFF0C;&#x5176;&#x4F18;&#x70B9;&#x624D;&#x80FD;&#x4F53;&#x73B0;&#x51FA;&#x6765;&#xFF0C;&#x56E0;&#x4E3A;&#x5927;&#x578B;&#x9879;&#x76EE;&#x7531;&#x591A;&#x4E2A;&#x6A21;&#x5757;&#x7EC4;&#x5408;&#x800C;&#x6210;&#xFF0C;&#x4E0D;&#x540C;&#x6A21;&#x5757;&#x53EF;&#x80FD;&#x53C8;&#x7531;&#x4E0D;&#x540C;&#x4EBA;&#x7F16;&#x5199;&#xFF0C;&#x5728;&#x5BF9;&#x63A5;&#x4E0D;&#x540C;&#x6A21;&#x5757;&#x65F6;&#x9759;&#x6001;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x4F1A;&#x5728;&#x7F16;&#x8BD1;&#x9636;&#x6BB5;&#x627E;&#x51FA;&#x53EF;&#x80FD;&#x5B58;&#x5728;&#x7684;&#x95EE;&#x9898;&#x3002;
TypeScript &#x7684;&#x7F3A;&#x70B9;&#x5728;&#x4E8E;&#x8BED;&#x6CD5;&#x76F8;&#x5BF9;&#x4E8E; JavaScript &#x66F4;&#x52A0;&#x5570;&#x55E6;&#xFF0C;&#x5E76;&#x4E14;&#x65E0;&#x6CD5;&#x76F4;&#x63A5;&#x8FD0;&#x884C;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x6216; Node.js &#x73AF;&#x5883;&#x4E0B;&#x3002;</p>
<pre><code class="lang-typescript"><span class="hljs-comment">// &#x9759;&#x6001;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x673A;&#x5236;&#x4F1A;&#x68C0;&#x67E5;&#x4F20;&#x7ED9; hello &#x51FD;&#x6570;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">hello</span>(<span class="hljs-params">content: <span class="hljs-built_in">string</span></span>) </span>{
  <span class="hljs-keyword">return</span> <span class="hljs-string">`Hello, <span class="hljs-subst">${content}</span>`</span>;
}
<span class="hljs-keyword">let</span> content = <span class="hljs-string">&apos;word&apos;</span>;
hello(content);
</code></pre>
<h3 id="flow">Flow</h3>
<p><a href="https://flow.org" target="_blank">Flow</a> &#x4E5F;&#x662F; JavaScript &#x7684;&#x4E00;&#x4E2A;&#x8D85;&#x96C6;&#xFF0C;&#x5B83;&#x7684;&#x4E3B;&#x8981;&#x7279;&#x70B9;&#x662F;&#x4E3A; JavaScript &#x63D0;&#x4F9B;&#x9759;&#x6001;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#xFF0C;&#x548C; TypeScript &#x76F8;&#x4F3C;&#x4F46;&#x66F4;&#x7075;&#x6D3B;&#xFF0C;&#x53EF;&#x4EE5;&#x8BA9;&#x4F60;&#x53EA;&#x5728;&#x9700;&#x8981;&#x7684;&#x5730;&#x65B9;&#x52A0;&#x4E0A;&#x7C7B;&#x578B;&#x68C0;&#x67E5;&#x3002;</p>
<h3 id="scss">SCSS</h3>
<p><a href="http://sass-lang.com" target="_blank">SCSS</a> &#x53EF;&#x4EE5;&#x8BA9;&#x4F60;&#x7528;&#x7A0B;&#x5E8F;&#x5458;&#x7684;&#x65B9;&#x5F0F;&#x5199; CSS&#x3002;&#x5B83;&#x662F;&#x4E00;&#x79CD; CSS &#x9884;&#x5904;&#x7406;&#x5668;&#xFF0C;&#x57FA;&#x672C;&#x601D;&#x60F3;&#x662F;&#x7528;&#x548C; CSS &#x76F8;&#x4F3C;&#x7684;&#x7F16;&#x7A0B;&#x8BED;&#x8A00;&#x5199;&#x5B8C;&#x540E;&#x518D;&#x7F16;&#x8BD1;&#x6210;&#x6B63;&#x5E38;&#x7684; CSS &#x6587;&#x4EF6;&#x3002;</p>
<pre><code class="lang-scss"><span class="hljs-variable">$blue</span>: <span class="hljs-number">#1875e7</span>;&#x3000;
<span class="hljs-selector-tag">div</span> {
  <span class="hljs-attribute">color</span>: <span class="hljs-variable">$blue</span>;
}
</code></pre>
<p>&#x91C7;&#x7528; SCSS &#x53BB;&#x5199; CSS &#x7684;&#x597D;&#x5904;&#x5728;&#x4E8E;&#x53EF;&#x4EE5;&#x65B9;&#x4FBF;&#x5730;&#x7BA1;&#x7406;&#x4EE3;&#x7801;&#xFF0C;&#x62BD;&#x79BB;&#x516C;&#x5171;&#x7684;&#x90E8;&#x5206;&#xFF0C;&#x901A;&#x8FC7;&#x903B;&#x8F91;&#x5199;&#x51FA;&#x66F4;&#x7075;&#x6D3B;&#x7684;&#x4EE3;&#x7801;&#x3002;
&#x548C; SCSS &#x7C7B;&#x4F3C;&#x7684; CSS &#x9884;&#x5904;&#x7406;&#x5668;&#x8FD8;&#x6709; <a href="http://lesscss.org" target="_blank">LESS</a> &#x7B49;&#x3002;</p>
<hr>
<p>&#x4F7F;&#x7528;&#x65B0;&#x8BED;&#x8A00;&#x53EF;&#x4EE5;&#x63D0;&#x5347;&#x7F16;&#x7801;&#x6548;&#x7387;&#xFF0C;&#x4F46;&#x662F;&#x5FC5;&#x987B;&#x628A;&#x6E90;&#x4EE3;&#x7801;&#x8F6C;&#x6362;&#x6210;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5728;&#x6D4F;&#x89C8;&#x5668;&#x73AF;&#x5883;&#x4E0B;&#x8FD0;&#x884C;&#x7684;&#x4EE3;&#x7801;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="./" class="navigation navigation-prev " aria-label="Previous page: 第1章 入门">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="1-2常见的构建工具及对比.html" class="navigation navigation-next " aria-label="Next page: 1-2 常见的构建工具及对比">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"1-1 前端的发展","level":"1.3.1","depth":2,"next":{"title":"1-2 常见的构建工具及对比","level":"1.3.2","depth":2,"path":"1入门/1-2常见的构建工具及对比.md","ref":"1入门/1-2常见的构建工具及对比.md","articles":[]},"previous":{"title":"第1章 入门","level":"1.3","depth":1,"path":"1入门/README.md","ref":"1入门/README.md","articles":[{"title":"1-1 前端的发展","level":"1.3.1","depth":2,"path":"1入门/1-1前端的发展.md","ref":"1入门/1-1前端的发展.md","articles":[]},{"title":"1-2 常见的构建工具及对比","level":"1.3.2","depth":2,"path":"1入门/1-2常见的构建工具及对比.md","ref":"1入门/1-2常见的构建工具及对比.md","articles":[]},{"title":"1-3 安装与使用","level":"1.3.3","depth":2,"path":"1入门/1-3安装与使用.md","ref":"1入门/1-3安装与使用.md","articles":[]},{"title":"1-4 使用 Loader","level":"1.3.4","depth":2,"path":"1入门/1-4使用Loader.md","ref":"1入门/1-4使用Loader.md","articles":[]},{"title":"1-5 使用 Plugin","level":"1.3.5","depth":2,"path":"1入门/1-5使用Plugin.md","ref":"1入门/1-5使用Plugin.md","articles":[]},{"title":"1-6 使用 DevServer","level":"1.3.6","depth":2,"path":"1入门/1-6使用DevServer.md","ref":"1入门/1-6使用DevServer.md","articles":[]},{"title":"1-7 核心概念","level":"1.3.7","depth":2,"path":"1入门/1-7核心概念.md","ref":"1入门/1-7核心概念.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":["adsense","github-buttons"],"root":"./docs","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"github-buttons":{"buttons":[{"user":"gwuhaolin","type":"follow","size":"small","width":"150"},{"user":"gwuhaolin","repo":"dive-into-webpack","type":"star","size":"small"}]},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":true,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"adsense":{"client":"ca-pub-9697944574373240","slot":"9319793387","format":"auto","element":".page-inner section","position":"top"},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"吴浩麟","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"isbn":"9787121331725","variables":{},"title":"深入浅出 Webpack","language":"zh-hans","gitbook":"*","description":"本书按照入门、配置、实战、优化、原理的路线层层深入，涵盖了 Webpack 的方方面面。对于小白，本书可以作为 Webpack 入门教程，对于老手，本书可以进一步加深你对 Webpack 的理解。"},"file":{"path":"1入门/1-1前端的发展.md","mtime":"2021-10-27T07:12:28.535Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-10-27T07:13:20.653Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-adsense/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

